import { IsNotEmpty, IsOptional } from 'class-validator';
import type { CreateAtSort } from 'src/dtos';

export class QueryUserDto {
  @IsNotEmpty({ message: '每页数量必填' })
  limit: number;

  @IsNotEmpty({ message: '页码序号必填' })
  page: number;

  @IsOptional()
  type?: number;

  @IsOptional()
  status?: number;

  @IsOptional()
  sex?: number;

  @IsOptional()
  username?: string;

  @IsOptional()
  mobile?: string;

  @IsOptional()
  email?: string;

  @IsOptional()
  nickname?: string;

  @IsOptional()
  real_name?: string;

  @IsOptional()
  id_card?: string;

  @IsOptional()
  description?: string;

  @IsOptional()
  label?: string;

  /**
   * 创建时间排序
   * @example 'desc'
   */
  @IsOptional()
  created_at?: CreateAtSort;
}
